home *** CD-ROM | disk | FTP | other *** search
/ Games of Daze / Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso / x2ftp / msdos / libs / 3dvect39 / equ.inc < prev    next >
Encoding:
Text File  |  1994-10-30  |  16.1 KB  |  444 lines

  1. ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  2. ;
  3. ; Filename     : equ.inc
  4. ; Included from: 3D1.ASM, 3D2.ASM, 3D3.ASM
  5. ; Description  : Conditional assembley variables and general constants.
  6. ;              : No data is here, just parameters
  7. ;
  8. ; Written by: John McCarthy
  9. ;             1316 Redwood Lane
  10. ;             Pickering, Ontario.
  11. ;             Canada, Earth, Milky Way (for those out-of-towners)
  12. ;             L1X 1C5
  13. ;
  14. ; Internet/Usenet:  BRIAN.MCCARTHY@CANREM.COM
  15. ;         Fidonet:  Brian McCarthy 1:229/15
  16. ;   RIME/Relaynet: ->CRS
  17. ;
  18. ; Home phone, (905) 831-1944, don't call at 2 am eh!
  19. ;
  20. ; John Mccarthy would really love to work for a company programming Robots
  21. ; or doing some high intensive CPU work.  Hint. Hint.
  22. ;
  23. ; Send me your protected mode source code!
  24. ; Send me your Objects!
  25. ; But most of all, Send me a postcard!!!!
  26. ;
  27. ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  28.  
  29. yes             equ 0
  30. no              equ -1
  31.  
  32. ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  33. ; constants for optimal conditional assembley
  34. ; don't pay for features you'll never use! (timewise)
  35. ; these are the most _sineifigant factors in determining speed!!
  36. ; note:_bitmaps also slow things down...
  37. ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  38.  
  39. usez            equ yes        ; z camera rotations ommited if no, saves 12 imuls
  40.                                ; this speeds up computation in "_compound" matrix
  41. div_256         equ 8          ; will all locations be divided by 256? (set to 8 or 0)
  42.  
  43. ; thats the end of conditional assembley constants!
  44.  
  45. ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  46. ; colour crap
  47. ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  48.  
  49. bulletcolour    equ 4          ; what colour is single point object, from palette
  50. shading_colours equ 32         ; number of colours for _lambert shading, 16 or 32. see math.inc
  51.  
  52. ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  53. ; variables for object and polygon routine
  54. ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  55.  
  56. tolerance       equ 300        ; max center of gravity offset for objects/ratio (onscreen pixel distance)
  57. ztruncate       equ 80         ; if z< ztruncate, z=ztruncate:for _make3d (16 bit distance)
  58. minz            equ 100        ; minimum z before object can be seen:for _make1obj (16 bit distance)
  59. maxz            equ 500000     ; maximum distance in any axis object can be seen (24 bit distance)
  60. followtol       equ 15         ; tolerance if already looking at object,_cam_newfollow (angle)
  61. collision       equ 10         ; tolerence for merging two objects into 1 (for 3d3, 16 bit distance)
  62.  
  63. ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  64. ; polygon constants
  65. ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  66.  
  67. maxpoints       equ 700        ; max points (*total* on screen if 3d2)
  68. maxsurfaces     equ 700        ; max object surfaces (*total* on screen if 3d2)
  69. mult            equ 4          ; shl ax,mult for number of sides
  70. maxpolys        equ 16         ; 2^mult   ; max sides to a polygon,must = 2^mult,keep small!!
  71. maxobjects      equ 40         ; 50,100,?? ; number of objects possible on screen at once
  72.  
  73. ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  74. ; data definition allocation
  75. ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  76.  
  77. numberofshapes  equ 32         ; number of 3d shapes to allocate space for
  78. numberofbitmaps equ 32         ; number of bitmaps to allocate space for
  79. numberofpals    equ 256        ; number of selectable palette cross refnce tables
  80. numberofstones  equ 256        ; number of stones textures available
  81.  
  82. ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  83. ; Options for objects - note, some of these commands must be allowed to overlap
  84. ; point,line,texture,himap,lomap must not be at the same bit  location  as  the
  85. ; texture options.  eg line cannot equal 128 because  this  would  get  smushed
  86. ; with shade.
  87. ;
  88. ; To re-cap:
  89. ;
  90. ; There cannot be conflicts between (texture options) and (surface types)
  91. ;
  92. ; There cannot be conflicts between (surface types) and (surface commands or
  93. ; internal commands or visibility commands)
  94. ;
  95. ; Conflicts between (texture options) and (surface commands or internal
  96. ; commands or visibility commands) are not important
  97. ;
  98. ; The texture options wavey,mesh and  glenz MUST be accessable from the  high
  99. ; byte of a register.  Considering these  options cannot  be  combined,  they
  100. ; can be added to perform other texture options.  See poly.inc for the  table
  101. ; Anything with the glenz texture in it, will be polyfilled up/down. Textures
  102. ; without the glenz option will be filled left/right.
  103. ;
  104. ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  105.  
  106. ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  107. ; texture options
  108. ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  109. wavey           equ 512        ; texture options see objects.inc for explanations
  110. shade           equ 2
  111. inverse         equ 4
  112. glow            equ shade+inverse
  113. last            equ 8
  114. texture         equ 16
  115. mesh            equ 256
  116. auto_s          equ 128        ; pre-calculate shading intensity when angles=0,0,0
  117. glenz           equ 1024
  118. stone           equ glenz+mesh ; copy _bitmap to screen (non-rotatable,non-scalable)
  119.  
  120. ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  121. ; surface types
  122. ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  123. point           equ 32         ; surface types
  124. line            equ 64         ; these options must not conflict with the stuff above or below
  125.  
  126. ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  127. ; surface commands
  128. ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  129. iterate         equ 256
  130. matrix          equ 512
  131.  
  132. ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  133. ; internal commands, not for use by you
  134. ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  135. normal          equ 1024
  136. centroid        equ 1
  137.  
  138. ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  139. ; visibility determination methods
  140. ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  141. both            equ 1
  142. double          equ 2
  143. onscr           equ 4
  144. check           equ 8
  145.  
  146. ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  147. ; special non-surface oriented commands
  148. ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  149. special         equ 128        ; any command that the high bit set (128) will not have any connection data
  150. himap           equ special+0
  151. lomap           equ special+1
  152. push_matrix     equ special+2  ; push matrix
  153. pop_matrix      equ special+3  ; pop matrix
  154. push_location   equ special+4  ; push location
  155. pop_location    equ special+5  ; pop location
  156. sub_object      equ special+6  ; sub_object = matrix+check+iteration+both,?,?,?,?,0,0
  157. static_sub_object equ special+7 ; non-rotatable sub_object = check+iteration+both,?,?,?,?,0,0
  158. gosub           equ special+8  ; just like the basic command - sends the connection routine to another location in memory (16bit relative), pushes old offset
  159. return          equ special+9  ; just like the basic command - return offset from stack and go to it (32bit absolute)
  160. goto_offset     equ special+10 ; just like the basic command - go to offset specified (16bit relative)
  161.  
  162. ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  163. ; commands for _onoff[esi]
  164. ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  165. mainobject_on   equ 1
  166. sub_object_on   equ 2
  167. hold_object     equ 4
  168.  
  169. ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  170. ; commands for _userotate[esi]
  171. ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  172. full_rotations  equ 0          ; object has full rotation capability
  173. no_rotation     equ 1          ; object has no rotation
  174. s_point         equ point      ; static point/bullet
  175. s_himap         equ himap      ; object is a static bitmap - like explosions...
  176. s_lomap         equ lomap
  177.  
  178. ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  179. ; animation settings
  180. ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  181.  
  182. number_of_spaces equ 20        ; number of spaces free for animation headers
  183.  
  184. ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  185. ; where is the camera in the list
  186. ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  187.  
  188. cameraobject    equ 0          ; camera is zero'th object in list
  189.  
  190. ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  191. ; ===== general xmode constants =====
  192. ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  193.  
  194. false           equ 0
  195. true            equ -1
  196. nil             equ 0
  197.  
  198. b               equ byte ptr
  199. w               equ word ptr
  200. d               equ dword ptr
  201. o               equ offset
  202. f               equ far ptr
  203. s               equ short
  204. ?x4             equ <?,?,?,?>
  205. ?x3             equ <?,?,?>
  206.  
  207. ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  208. ; ===== vga register values =====
  209. ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  210.  
  211. vga_segment     equ d 0a0000h  ; vga memory segment (ok, this is protected mode, right?, so this is the actual address - hahahaha to all you real mode losers...)
  212.  
  213. attrib_ctrl     equ 03c0h      ; vga attribute controller
  214. gc_index        equ 03ceh      ; vga graphics controller
  215. sc_index        equ 03c4h      ; vga sequencer controller
  216. sc_data         equ 03c5h      ; vga sequencer data port
  217. crtc_index      equ 03d4h      ; vga crt controller
  218. crtc_data       equ 03d5h      ; vga crt controller data
  219. misc_output     equ 03c2h      ; vga misc register
  220. input_1         equ 03dah      ; input status #1 register
  221.  
  222. dac_write_addr  equ 03c8h      ; vga dac write addr register
  223. dac_read_addr   equ 03c7h      ; vga dac read addr register
  224. pel_data_reg    equ 03c9h      ; vga dac/pel data register r/w
  225.  
  226. pixel_pan_reg   equ 033h       ; attrib index: pixel pan reg
  227. map_mask        equ 002h       ; sequ index: write map mask reg
  228. read_map        equ 004h       ; gc index: read map register
  229. start_disp_hi   equ 00ch       ; crtc index: display start hi
  230. start_disp_lo   equ 00dh       ; crtc index: display start lo
  231.  
  232. map_mask_plane1 equ 00102h     ; map register + plane 1
  233. map_mask_plane2 equ 01102h     ; map register + plane 2
  234. all_planes_on   equ 00f02h     ; map register + all bit planes
  235.  
  236. chain4_off      equ 00604h     ; chain 4 mode off
  237. async_reset     equ 00100h     ; (a)synchronous reset
  238. sequ_restart    equ 00300h     ; sequencer restart
  239.  
  240. latches_on      equ 00008h     ; bit mask + data from latches
  241. latches_off     equ 0ff08h     ; bit mask + data from cpu
  242.  
  243. vert_retrace    equ 08h        ; input_1: vertical retrace bit
  244. plane_bits      equ 03h        ; bits 0-1 of xpos = plane #
  245. all_planes      equ 0fh        ; all bit planes selected
  246. char_bits       equ 0fh        ; bits 0-3 of character data
  247.  
  248. get_char_ptr    equ 01130h     ; vga bios func: get char set
  249. rom_8x8_lo      equ 03h        ; rom 8x8 char set lo pointer
  250. rom_8x8_hi      equ 04h        ; rom 8x8 char set hi pointer
  251.  
  252. num_modes       equ 8          ; # of mode x variations
  253.  
  254. ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  255. ; mode x definitions
  256. ;
  257. ;  0 =  320 x 200
  258. ;  1 =  320 x 400
  259. ;  2 =  360 x 200
  260. ;  3 =  360 x 400
  261. ;  4 =  320 x 240
  262. ;  5 =  320 x 480
  263. ;  6 =  360 x 240
  264. ;  7 =  360 x 480
  265. ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  266.  
  267. videomode       equ 1
  268.  
  269.                 if videomode eq 0
  270.  
  271. xmode           equ videomode
  272. xmax            equ 160        ; right colomn just beyond screen for clipping
  273. xmin            equ -160       ; left coloumn on screen, x's must be "and 0fffch"
  274. ymax            equ 100        ; lower row just beyond screen
  275. ymin            equ -100       ; upper row on screen
  276. xactual         equ 320        ; guess...
  277. yactual         equ 200
  278.  
  279. _xcenter        equ 160        ; screen center x,y for actual screen point (0,0)
  280. _ycenter        equ 100        ; make sure clipping still stays inside screen
  281.  
  282. ratiox          equ 320        ; aspect ratio for 3d conversion (zoom)
  283. ratioy          equ 240        ; make x and y different to fine tune (draw circle)
  284. pages           equ 4          ; # of video pages mode will support, (don't modify)
  285.  
  286.                 elseif videomode eq 1
  287.  
  288. xmode           equ videomode
  289. xmax            equ 160
  290. xmin            equ -160
  291. ymax            equ 200
  292. ymin            equ -200
  293. xactual         equ 320
  294. yactual         equ 400
  295.  
  296. _xcenter        equ 160
  297. _ycenter        equ 200
  298.  
  299. ratiox          equ 320
  300. ratioy          equ 464
  301. pages           equ 2
  302.  
  303.                 elseif videomode eq 2
  304.  
  305. xmode           equ videomode
  306. xmax            equ 180
  307. xmin            equ -180
  308. ymax            equ 100
  309. ymin            equ -100
  310. xactual         equ 360
  311. yactual         equ 200
  312.  
  313. _xcenter        equ 180
  314. _ycenter        equ 100
  315.  
  316. ratiox          equ 320
  317. ratioy          equ 240
  318. pages           equ 3
  319.  
  320.                 elseif videomode eq 3
  321.  
  322. xmode           equ videomode
  323. xmax            equ 180
  324. xmin            equ -180
  325. ymax            equ 200
  326. ymin            equ -200
  327. xactual         equ 360
  328. yactual         equ 400
  329.  
  330. _xcenter        equ 180
  331. _ycenter        equ 200
  332.  
  333. ratiox          equ 300
  334. ratioy          equ 416
  335. pages           equ 1
  336.  
  337.                 elseif videomode eq 4
  338.  
  339. xmode           equ videomode
  340. xmax            equ 160
  341. xmin            equ -160
  342. ymax            equ 120
  343. ymin            equ -120
  344. xactual         equ 320
  345. yactual         equ 240
  346.  
  347. _xcenter        equ 160
  348. _ycenter        equ 120
  349.  
  350. ratiox          equ 300
  351. ratioy          equ 280
  352. pages           equ 3
  353.  
  354.                 elseif videomode eq 5
  355.  
  356. xmode           equ videomode
  357. xmax            equ 160
  358. xmin            equ -160
  359. ymax            equ 240
  360. ymin            equ -240
  361. xactual         equ 320
  362. yactual         equ 480
  363.  
  364. _xcenter        equ 160
  365. _ycenter        equ 240
  366.  
  367. ratiox          equ 260
  368. ratioy          equ 460
  369. pages           equ 1
  370.  
  371.                 elseif videomode eq 6
  372.  
  373. xmode           equ videomode
  374. xmax            equ 180
  375. xmin            equ -180
  376. ymax            equ 120
  377. ymin            equ -120
  378. xactual         equ 360
  379. yactual         equ 240
  380.  
  381. _xcenter        equ 180
  382. _ycenter        equ 120
  383.  
  384. ratiox          equ 320
  385. ratioy          equ 260
  386. pages           equ 3
  387.  
  388.                 elseif videomode eq 7
  389.  
  390. xmode           equ videomode
  391. xmax            equ 180
  392. xmin            equ -180
  393. ymax            equ 240
  394. ymin            equ -240
  395. xactual         equ 360
  396. yactual         equ 480
  397.  
  398. _xcenter        equ 180
  399. _ycenter        equ 240
  400.  
  401. ratiox          equ 280
  402. ratioy          equ 448
  403. pages           equ 1
  404.  
  405. ; if videomode = -1, custom configuration
  406.  
  407.                 elseif videomode eq -1
  408.  
  409. xmode           equ 1
  410. xmax            equ 160
  411. xmin            equ -160
  412. ymax            equ 200
  413. ymin            equ -200
  414. xactual         equ 320
  415. yactual         equ 400
  416.  
  417. _xcenter        equ 160
  418. _ycenter        equ 200
  419.  
  420. ratiox          equ 320
  421. ratioy          equ 464
  422. pages           equ 2
  423.  
  424. ; if videomode = -2, custom configuration
  425.  
  426.                 elseif videomode eq -2
  427.  
  428. xmode           equ 0
  429. xmax            equ 36*4
  430. xmin            equ -36*4
  431. ymax            equ 60
  432. ymin            equ -60
  433. xactual         equ 320
  434. yactual         equ 200
  435.  
  436. _xcenter        equ 160
  437. _ycenter        equ 100
  438.  
  439. ratiox          equ 320
  440. ratioy          equ 240
  441. pages           equ 2
  442.  
  443.                 endif
  444.